#ifndef C3POM_PORTAL_BUF_MANAGER_H
#define C3POM_PORTAL_BUF_MANAGER_H
#include"service.h"
#include"command.h"
#include"application.h"
#include"portal.h"
#include<string>
#include<map>
#include<vector>
#include<omp.h>
#include"log.h"
namespace c3pom
{
	class PortalBufManager:public Service
	{
		private:
			omp_lock_t lock;
			Log* log;
			std::map<std::string,std::string> portalBufs;
			friend class Lspb;
			friend class Pbtest;
			class Lspb:public Command
			{
			public:
				int exec(std::vector<std::string>);
				std::string desc();
				std::string name();
			};
			class Pbtest:public Command
			{
				public:
					int exec(std::vector<std::string>);
					std::string desc();
					std::string name();
			};
		public:
			PortalBufManager();
			static PortalBufManager* getInstance();
			PortalBuf* createPortalBuf(std::string name);
			std::string name();
			std::string desc();
			void run();
	};
}
#endif
